function LoginController() {
	
    var lc = this;
        
	this.init = function() {
            //this.model.loadRoles(roles);
            $('#login_form_send').click(function() {
                    lc.sendLogin(this);
            });
        },
	
	/*
	 *
	 */
	this.sendLogin = function() {
	    var item = new Object();
        item['password'] = $("#login_form_pass").val();
        item['email'] = $("#login_form_name").val();
        item['remember_me'] = $("#login_form_remember_me").val();
        
        $.ajax({
            type: "POST",
            url: "login.htm",
            data: {
                email: item['email'],
                password: item['password'],
                remember_me: item['remember_me']
            },
            dataType: "json",
            success: function(response) {
                if (response.res == "false") {
                    alert(response.error);
                }
                window.location.href = "catalog_view.htm";
            }
        });
	}
	
}

